package com.qc.wintrax.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;


/**
 * @author xiaobaodou
 * @Description:() create at  2016/5/19 15:53
 **/
public class HBDevOpenHelper extends DaoMaster.OpenHelper {

    public HBDevOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory) {
        super(context, name, factory);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        switch (oldVersion) {
            case 2:
                //创建新表，注意createTable()是静态方法
                MapAddressDao.createTable(db, true);
                MapInfoDao.createTable(db,true);
                LineNameDao.createTable(db,true);
                MarkerInfoDao.createTable(db,true);
//                infoTypeDao.createTable(db,true);

                // 加入新字段
                // db.execSQL("ALTER TABLE 'moments' ADD 'audio_path' TEXT;");

                // TODO
                break;
        }
    }
}